<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="../../include/tag.jsp" %>
<!DOCTYPE html>
<html lang="zh">
<head>
    <title>商品数据</title>
    <link rel="stylesheet" href="${ctx}/css/common/list.css">
    <link rel="stylesheet" href="${ctx}/css/common/table.css">
    <link rel="stylesheet" href="${ctx}/css/ui/system/main/main.css">
    <%@include file="../../include/commonFile.jsp" %>
    <style type="text/css">
        .head-main-car .info-box {
            flex: 1;
        }
        .info-box .box-content .box-inner {
            text-align: center;
        }
    </style>
</head>
<body>
<!--头部-->
<%@include file="../../include/header.jsp" %>
<div class="index-outside">
    <%@include file="../../include/sidebar.jsp" %>
    <!--内容-->
    <section>
        <div class="section-main">
            <form class="layui-form" action="${ctx}/mall/data/list.do" id="myForm" method="post">
                <input type="hidden" name="pageNo" id="pageNo"/>
                <div class="f-search-bar">
                    <div class="search-container">
                        <ul class="search-form-content">
                            <li class="form-item-inline"><label class="search-form-lable">机构名称</label>
                                <div class="layui-input-inline">
                                    <input type="text" name="partnerName" autocomplete="off" class="layui-input"
                                           value="${mallData.partnerName}" placeholder="机构名称">
                                </div>
                            </li>
                            <li class="form-item-inline">
                                <div class="sub-btns">
                                    <a class="layui-btn layui-btn-danger"
                                       href="javascript:submitFunction('#myForm')">查询</a>
                                    <a class="layui-btn layui-btn-normal"
                                       href="javascript:resetFunction('#myForm')">重置</a>
                                </div>
                            </li>
                        </ul>
                        <ul class="search-form-content">
                            <li class="form-item"><label class="search-form-lable">查询日期</label>
                                <div class="check-btn-inner" id="timeType">
                                    <a id="all" href="javascript:void(0);"
                                       onclick="setTimeType($(this),0,'#myForm')" ${empty commonInput.timeType || commonInput.timeType == 0 ? 'class="active"' : ''}>全部</a>
                                    <a href="javascript:void(0);"
                                       onclick="setTimeType($(this),1,'#myForm')" ${commonInput.timeType == 1 ? 'class="active"' : ''}>今天</a>
                                    <a href="javascript:void(0);"
                                       onclick="setTimeType($(this),2,'#myForm')" ${commonInput.timeType == 2 ? 'class="active"' : ''}>本周内</a>
                                    <a href="javascript:void(0);"
                                       onclick="setTimeType($(this),3,'#myForm')" ${commonInput.timeType == 3 ? 'class="active"' : ''}>本月内</a>
                                    <input type="hidden" name="timeType" value="${commonInput.timeType}"/>
                                </div>
                                <div class="layui-inline">
                                    <div class="layui-input-inline">
                                        <input class="layui-input" type="text" name="createStart" readonly="readonly"
                                               value="${commonInput.createStart}" placeholder="开始日"
                                        >
                                    </div>
                                    -
                                    <div class="layui-input-inline">
                                        <input class="layui-input" type="text" name="createEnd" readonly="readonly"
                                               value="${commonInput.createEnd}" placeholder="截止日"
                                        >
                                    </div>
                                </div>
                            </li>
                        </ul>
                    </div>
                </div>
            </form>
            <div class="head-main-car">
                <div class="info-box bg-light-blue">
                    <div class="box-content">
                        <div class="box-inner">
                            <div class="num">${statistics.allOrderNum}</div>
                            <div class="info">总订单</div>
                        </div>
                    </div>
                </div>
                <div class="info-box bg-green">
                    <div class="box-content">
                        <div class="box-inner">
                            <div class="num">${statistics.allTurnover}</div>
                            <div class="info">总成交金额</div>
                        </div>
                    </div>
                </div>
                <div class="info-box bg-orange">
                    <div class="box-content">
                        <div class="box-inner">
                            <div class="num">${statistics.dealPartnerNum}</div>
                            <div class="info">有成交的机构</div>
                        </div>
                    </div>
                </div>
                <div class="info-box bg-red">
                    <div class="box-content">
                        <div class="box-inner">
                            <div class="num">${statistics.averageOrderNum}</div>
                            <div class="info">机构平均订单</div>
                        </div>
                    </div>
                </div>
                <div class="info-box bg-blue">
                    <div class="box-content">
                        <div class="box-inner">
                            <div class="num">${statistics.averageTurnover}</div>
                            <div class="info">机构平均成交金额</div>
                        </div>
                    </div>
                </div>
                <div class="info-box bg-light-blue">
                    <div class="box-content">
                        <div class="box-inner">
                            <div class="num">${statistics.averageIncome}</div>
                            <div class="info">机构平均利润</div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="list-content">
                <div class="cl">
                    <table class="layui-table">
                        <colgroup>
                            <col width="100">
                            <col width="100">
                            <col width="100">
                            <col width="100">
                            <col width="100">
                        </colgroup>
                        <thead>
                        <tr>
                            <th>机构名称</th>
                            <th>订单（单）</th>
                            <th>成交金额（元）</th>
                            <th>收益（元）</th>
                            <th>商品销量</th>
                        </tr>
                        </thead>
                        <tbody>
                        <c:forEach var="mallData" items="${list}">
                            <tr>
                                <td>${mallData.partnerName}</td>
                                <td>${mallData.orderNum}</td>
                                <td>${mallData.turnover}</td>
                                <td>${mallData.income}</td>
                                <td>${mallData.salesNum}</td>
                            </tr>
                        </c:forEach>
                        </tbody>
                    </table>
                </div>
            </div>
            <div id="page_content" class="page-container"></div>
        </div><!--底部-->
        <%@include file="../../include/footer.jsp" %>
    </section>
</div>

<script type="text/javascript" src="${ctx}/script/common/list.js"></script>
<script type="text/javascript" src="${ctx}/script/common/table_option.js"></script>
<script type="text/javascript">
    $(function () {
        //加载分页
        loadPageNew({
            elem: 'page_content',
            totalCount: '${page.totalCount}',
            limit: '${page.limit}',
            page: '${page.page}'
        });
        layui.use(['laydate'], function () {
            var laydate = layui.laydate;

            // 查询发布日期
            var start = {
                elem: 'input[name=createStart]'
            };

            var end = {
                elem: 'input[name=createEnd]'
            };
            laydate.render(start);
            laydate.render(end);
        });
    })
</script>

<script type="text/javascript">
    txz.initHeader({
        nav: [{
            name: '商品数据',
            curr: true
        }],
        info: '<span class="f12">共<b id="totalCount">${page.totalCount}</b>条记录</span>'
    });
</script>
</body>
</html>